const listFilepaths = require('list-filepaths');
const path = require("path");

let root = path.join(__dirname, "../../")
listFilepaths(root, {
  depth: 3,
  // relative: true,
  reject: (p) => {
    let b = path.basename(p);
    // debugger
    if ([".git", "node_modules"].includes(b)) {
      return true;
    }

    return false
  },
}).then(
  /**
   * @param {String[]} filepaths
   */
  filepaths => {
    path
    // console.log(filepaths)
    // console.log(filepaths.map(p=>path.relative(p,root)))
    console.log(filepaths.map(p =>
      path.parse(p)))

    
    console.log(filepaths.map(p => p.replace(root, "")))
    /**
     * [ '.gitignore',
  '.vscode\\launch.json',
  '7moor.md',
  'eastday.md',
  'index.js',
  'lib\\index.js',
  'package-lock.json',
  'package.json',
  'README.md',
  'test\\0611\\index.js',
  'test\\0616\\index.js',
  'test\\0620\\index.js',
  'test\\0621listfiles\\index.js',
  'tmp\\0.2851840144041333\\1.10GB.mkv.sf-part1',
  'tmp\\0.2851840144041333\\1.10GB.mkv.sf-part2',
  'tmpfiles\\1.10GB.mkv',
  'tmpfiles\\1000MB.wim.001',
  'tmpfiles\\1000MB.wim.002',
  'tmpfiles\\230MB.part',
  'tmpfiles\\30.4MB.mp4',
  'tmpfiles\\30.4MB.mp4.sf-part1',
  'tmpfiles\\30.4MB.mp4.sf-part2',
  'tmpfiles\\30.4MB.mp4.sf-part3',
  'tmpfiles\\30.4MB.mp4.sf-part4',
  'tmpfiles\\450MB.ctrip.fail.txt',
  'tmpfiles\\450MB.part',
  'tmpfiles\\900MB.part' ]
     */
  })